package org.tech4j.edi.api;

import org.tech4j.edi.api.context.RetryContext;

/**
 * @program: tech4j
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/7 11:17
 **/
public interface RetryExecutor {

    /**
     * 执行
     * @param retryContext retryContext
     * @param chain RetryExecutorChain
     */
    void execute(RetryContext retryContext, RetryExecutorChain chain);

    /**
     * 执行顺序
     * @return
     */
    int getOrder();

    /**
     * 是否跳过
     * @param retryContext
     * @return
     */
    default boolean skip(RetryContext retryContext) {
        return false;
    }
}
